<template>
  <div class="col p10 card">
    <label class="title">取物门控制</label>
    <div class="row_center mt">
      <el-button @click="onClickOpen" type="primary">打开</el-button>
      <el-button @click="onClickClose" type="primary">关闭</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { pick_door_ctrl } from '../../service/main_cmd';
import { dialog } from '../../service/ui';


async function onClickOpen() {

  try {
    await pick_door_ctrl(0);
    dialog.succ('打开成功');
  } catch (msg) {
    dialog.err(msg);
  }
}

async function onClickClose() {
  try {
    await pick_door_ctrl(1);
    dialog.succ('关闭成功');
  } catch (msg) {
    dialog.err(msg);
  }
}

</script>
